﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;

namespace StudyEnglish.Model
{
    [Table(Name = "Daily")]
    public class AppDaily : INotifyPropertyChanged, INotifyPropertyChanging
    {
        private int _ID;
        [Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
        public int ID
        {
            get { return _ID; }
            set
            {
                if (_ID != value)
                {
                    NotifyPropertyChanging("ID");
                    _ID = value;
                    NotifyPropertyChanged("ID");
                }
            }
        }

        private int _UserID;
        [Column]
        public int UserID
        {
            get { return _UserID; }
            set
            {
                if (_UserID != value)
                {
                    NotifyPropertyChanging("UserID");
                    _UserID = value;
                    NotifyPropertyChanged("UserID");
                }
            }
        }

        private int _Day;
        [Column]
        public int Day
        {
            get { return _Day; }
            set
            {
                if (_Day != value)
                {
                    NotifyPropertyChanging("Day");
                    _Day = value;
                    NotifyPropertyChanged("Day");
                }
            }
        }

        private int _VocabularyID;
        [Column]
        public int VocabularyID
        {
            get { return _VocabularyID; }
            set
            {
                if (_VocabularyID != value)
                {
                    NotifyPropertyChanging("VocabularyID");
                    _VocabularyID = value;
                    NotifyPropertyChanged("VocabularyID");
                }
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion

        #region INotifyPropertyChanging Members

        public event PropertyChangingEventHandler PropertyChanging;
        private void NotifyPropertyChanging(string propertyName)
        {
            if (PropertyChanging != null)
                PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
        }

        #endregion
   
    }
}
